
#coding:utf-8    
#使用自己的域名后，加上共享IP，发了2个QQ邮件，是可以送到的
#未来将使用 域名+独立IP 发送 15万封邮件，得到 1万的转化率  7-10%

import requests                                                          
import hashlib
import time

url="http://api.sendcloud.net/apiv2/mail/send"                       

arr = ['ltaotao007@163.com','25867114@qq.com','504473067@qq.com']

for qq_number in arr:
    #qq_email   = qq_number+'@qq.com'
    
    qq_subject = "币圈、IC0评级信息_"+qq_number
    
    hash_subject = hashlib.md5()   
    hash_subject.update(qq_subject.encode('utf-8'))   
    qq_subject = qq_subject + hash_subject.hexdigest() 

    qq_html    = qq_number+" 你已成功的从coin2world接受一封邮件，接下来就会看到各币行情分析，IC0评级信息-----"
    
    hash_html  = hashlib.sha256()
    hash_html.update(qq_html.encode('utf-8'))
    qq_html    = qq_html + hash_html.hexdigest()
    # 您需要登录SendCloud创建API_USER，使用API_USER和API_KEY才可以进行邮件的发送。
    params = {"apiUser": "tomtao_8222_Qzo83E", \
              "apiKey" : "Q5pqqRDfgjF739Th",\
              "from" : "service@8222.studio", \
              "fromName" : "每日币读", \
              "to" : qq_number, \
              "subject" : qq_subject, \
              "html": qq_html, \
              }
    print (params)
    r = requests.post(url, files={}, data=params)
    print ('send email return '+r.text)
    time.sleep(1)
